<%@page import="com.yymmarket.forum.util.DateUtil,com.yymmarket.forum.util.LevelUtil,com.yymmarket.forum.cache.ForumCache,com.yymmarket.forum.admin.AdminBean,com.yymmarket.forum.util.SessionUtil,com.yymmarket.framework.PagingBean,com.yymmarket.forum.util.BaseUtil,com.yymmarket.util.StringUtil,com.yymmarket.forum.bbs.ContentBean,java.util.List,com.yymmarket.forum.bbs.ContentService,com.yymmarket.forum.bbs.BBSService,com.yymmarket.framework.WebAction"%><%@ 
page contentType="text/vnd.wap.wml;charset=utf-8"%><%
response.setHeader("Cache-Control","no-cache");
WebAction webAction = new WebAction(request,response);
int id = webAction.getParameterInt("id");

int p = webAction.getParameterInt("p");

BBSService bbs = BBSService.getInstance();
ContentService contentService = ContentService.getInstance();

List<Integer> topIds = contentService.getTopIdsByBbsId(id);

int count = bbs.getBBSBeanById(id).getPrimeCount();
int limit = 10;
int start = p * limit;
if(p==0) {
	limit = limit - topIds.size();
} else if(p>0) {
	start = (p-1) * limit + limit - topIds.size();
}

List<Integer> contentList = contentService.getPrimeListByBssId(id,start,limit);

PagingBean paging = new PagingBean(webAction,count,10,"p");


//AdminBean adminBean = ForumCache.getAdminBean(LevelUtil.TYPE_BBS,id,uid);
%><?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
<card title="<%=ForumCache.getBBSBean(id).getTitle()+"("+ForumCache.getBBSBean(id).getTodayCount()+"新,总"+ForumCache.getBBSBean(id).getTotalCount()+"贴)" %>">
<p><%= BaseUtil.top(request,response) %><a href="forum.jsp?id=<%=id %>">全部</a>|精华|<a href="myPost.jsp?id=<%=id %>">我的帖子</a><br/><%

 
	for(int i = 0;i<contentList.size();i++) {
	ContentBean bean = contentService.getContentById(contentList.get(i));
%><%if(bean.isPrime()){%><%="[精]"%><%}else{%><%=i+1+p*limit%>.<%} %><a href="content.jsp?id=<%=bean.getId() %>&amp;fid=<%=bean.getBbsId() %>&amp;p1=<%=p %>"><%=StringUtil.toWml(bean.getTitle()) %></a>(回<%=bean.getReplyCount()%>|阅<%=bean.getReadCount()%>)<br/>
&gt;<%=StringUtil.toWml(bean.getUserName()) %>|<%=DateUtil.converDateToBefore(bean.getLastReplyTime(),"hh:mm") %><br/>
<%} %><%=paging.shuzifenyeAndShangXia(response.encodeURL("forum.jsp?id="+id),true,"|",response) %>
<a href="post.jsp?id=<%=id %>">发表帖子</a>|<a href="postX.jsp?id=<%=id %>">WAP2.0发表</a><br/>
<a href="rule.jsp?id=<%=id %>">版规</a>|<a href="forumAdmin.jsp?id=<%=id %>">版主</a>|<a href="forbid.jsp?id=<%=id %>">禁封列表</a><br/>
<a href="forum.jsp?id=<%=id %>">&lt;返回<%=bbs.getBBSBeanById(id).getTitle() %></a><br/>
<a href="index.jsp">&lt;&lt;返回论坛</a><br/>
<%= BaseUtil.bottom(request,response) %></p>
</card>
</wml>